Copyright ã1995 by NeXT Computer, Inc.  All Rights Reserved.

6

Distributed Objects

Classes

NXConnection

Inherits From:	NXInvalidationNotifier : Object

Conforms To:	NXSenderIsInvalid
NXReference (NXInvalidationNotifier)

Establishing a Connection

+ (NXProxy *)connectToName:(const char *)n	Connects to the named object

+ (NXProxy *)connectToName:(const char *)n 	Connects to the named object
fromZone:(NXZone *)z

+ (NXProxy *)connectToName:(const char *)n 	Connects to the named object
onHost:(const char *)h

+ (NXProxy *)connectToName:(const char *)n 	Connects to the named object
onHost:(const char *)h 
fromZone:(NXZone *)z

+ (NXProxy *)connectToPort:(NXPort *)p	Connects over the specified port

+ (NXProxy *)connectToPort:(NXPort *)p 	Connects over the specified port
fromZone:(NXZone *)z

+ (NXProxy *)connectToPort:(NXPort *)aPort 	Connects over the specified port
withInPort:(NXPort *)inPort

+ (NXProxy *)connectToPort:(NXPort *)aPort 	Connects over the specified port
withInPort:(NXPort *)inPort 
fromZone:(NXZone *)z

Ascertaining Connections

+ connections:(List *)l	Returns all connections

Registering an Object

+ registerRoot:anObject	Establishes a root object

+ registerRoot:anObject 	Establishes a root object
fromZone:(NXZone *)z

+ registerRoot:anObject 	Establishes a named root object
withName:(const char *)n

+ registerRoot:anObject 	Establishes a named root object
withName:(const char *)n 
fromZone:(NXZone *)z

Eliminating References

+ removeObject:anObject	Removes an object from all connections

Invalidation

+ unregisterForInvalidationNotification:	Unregisters an object for notifications
anObject

Statistics

+ (int)messagesReceived	Number of messages received over connection

Timeouts

+ setDefaultTimeout:(int)t	Sets default timeout for all connections

+ (int)defaultTimeout	Returns default timeout for all connections

- setInTimeout:(int)t	Sets in timeout

- setOutTimeout:(int)t	Sets out timeout

- (int)inTimeout	Returns in timeout

- (int)outTimeout	Returns out timeout

Zone Usage

+ setDefaultZone: (NXZone *)zone	Sets default zone for all connections

- (NXZone *)defaultZone	Returns default zone for all connections

Assigning a Delegate

- setDelegate:anObject	Sets the connection's delegate

- delegate	Returns the connection's delegate

Returning Port Objects

- (NXPort *)inPort	Returns the connection's in port

- (NXPort *)outPort	Returns the connection's out port

Getting and Setting the Root Object

- rootObject	Returns the connection's root object

- setRoot:anObject	Sets the connection's root object

Imported and Exported Objects

- (List *)remoteObjects	Returns the connection's remote proxies

- (List *)localObjects	Returns the connection's local proxies

Returning a Proxy

- getLocal:anId	Returns an object's local proxy

- newRemote:(unsigned)anObject 	Creates a remote proxy for an object
withProtocol:(Protocol *)p

Running a Connection

- run	Runs the connection and blocks

- runWithTimeout:(int)t	Runs the connection for a while

- runInNewThread	Runs the connecion asynchronously

- runFromAppKit	Runs the connection from DPS client

- runFromAppKitWithPriority:(int)priority	Runs the connection from DPS client

Freeing an NXConnection Instance

- free	Frees the connection

NXProxy

Inherits From:	none

Conforms To:	NXReference
NXTransport

Counting References

- addReference	Adds a reference

- free	Eliminates a reference

- references	Returns number of references

Returning the proxy's connection

- connectionForProxy	Returns the proxy's connection

Freeing an NXProxy instance

- freeProxy	Frees the proxy but not its real object

Determining if an object is a proxy

- isProxy	Identifies the receiver as a proxy

Specifying a protocol

- setProtocolForProxy:(Protocol *)proto	Sets the proxy's protocol for efficiency

Object Additions

Making Objects Distributable

- encodeRemotelyFor:	Transports an object using a proxy
(NXConnection *)connection
freeAfterEncoding:(BOOL *)flagp 
isBycopy:(BOOL)isBycopy

- (BOOL)isProxy	Identifies the receiver as an object